<template>
  <div class="mainBox">
    <div class="mainTitle">报名管理</div>

    <el-table
      :data="tableData"
      style="width: 100%"
      height=" calc(100vh - 310px)"
    >
      <el-table-column type="index" width="60" label="序号" />
      <!-- <el-table-column prop="user_name" label="用户名" width="" />
      <el-table-column prop="password" label="密码" width="" /> -->
      <el-table-column prop="real_name" label="姓名" width="" />
      <el-table-column prop="phone" label="手机号" width="" />
       <el-table-column prop="email" label="参赛类型" width="" />
      <el-table-column prop="in_time" label="入学时间" width="" />
       <el-table-column prop="sex" label="性别" width="" />
      <el-table-column prop="card_number" label="身份证号" width="" />
       <el-table-column prop="id_number" label="学生证号" width="" />
    </el-table>
    <Pagination @tips="tips" ref="pagination" />
  </div>
</template>
<script  setup>
import { signList } from "../../api/index";
import { ref, onMounted } from "vue";
import Pagination from "../../components/Pagination/index.vue";

const tableData = ref([]);

const pagination = ref(null);

const getList = (val) => {
  console.log(pagination.value.paginationData.currentPage);
  let parmas = {
    pageNo: val,
    pageSize: 10,
  };
  signList(parmas).then((res) => {
    if (res.code == 200) {
      pagination.value.paginationData.currentPage = Number(val);
      pagination.value.paginationData.total = Number(res.data.total);
      tableData.value = res.data.records;
    }
  });
};
onMounted(() => {
  getList(1);
});

const tips = (data) => {
  console.log(data);
  getList(data);
};
</script>
<style lang="scss" scoped>
.mainBox {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px;
  margin: 24px;
  min-height: calc(100vh - 56px - 48px - 40px);
  min-width: 1200px;
  overflow: auto;
  .mainTitle {
    font-size: 16px;
    font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
    font-weight: bold;
    color: #333333;
    margin-bottom: 16px;
    padding-top: 16px;
  }
  .btnBox {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
  }
}
:deep(.el-table) {
  --el-table-border-color: rgba(255, 255, 255, 0);
  .el-table__header .el-table__cell {
    background: #f7f8fa;
    font-size: 14px;
    font-family: MicrosoftYaHei;
    color: #333333;
    border-color: #ebebeb;
  }
  .el-table__header .is-group tr:first-child .el-table__cell {
    background: #f7f8fa;
  }
  .el-table__body .el-table__cell {
    padding: 0px;
    height: 32px;
    border-left: none;
    border-right: none;
    border-color: #ebebeb;
    font-size: 14px;
    font-family: MicrosoftYaHei;
    color: #666666;
  }

  .tableBtn {
    color: #155bd3;
    font-size: 14px;
    font-family: MicrosoftYaHei;
  }
}
</style>